<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Site made with Mobirise Website Builder v5.2.0, https://mobirise.com -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="generator" content="Mobirise v5.2.0, mobirise.com">
    <meta name="twitter:card" content="summary_large_image"/>
    <meta name="twitter:image:src" content="assets/images/index-meta.jpg">
    <meta property="og:image" content="assets/images/index-meta.jpg">
    <meta name="twitter:title" content="Phantoms">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    <link rel="shortcut icon" href="https://img.picgo.net/2024/10/18/frame-1-121x121bc5d878c1dd0d5fc.png"
          onerror="this.onerror=null;this.src='./assets/images/frame-1-121x121.png';"
          type="image/x-icon">
    <meta name="description" content="FF14、FC/CWLS Phantomsのホームページです。">
    <link rel="stylesheet" href="assets/web/assets/mobirise-icons2/mobirise2.css">
    <link rel="stylesheet" href="assets/tether/tether.min.css">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-reboot.min.css">
    <link rel="stylesheet" href="assets/dropdown/css/style.css">
    <link rel="stylesheet" href="assets/socicon/css/styles.css">
    <link rel="stylesheet" href="assets/theme/css/style.css">
    <link rel="preload" as="style" href="assets/mobirise/css/mbr-additional.css">
    <link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
    <link rel="stylesheet" href="additions/mouse.css">
    <title>
        Redirection Jump
    </title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            text-align: center;
            margin: 0;
            padding: 20px;
            background-color: #f8f8f8;
            color: #333;
        }
        h1 {
            font-size: 36px;
            color: #333;
            margin-bottom: 20px;
        }
        #loadingMessage {
            font-size: 24px;
            font-weight: bold;
            color: #333;
            padding: 20px;
            background-color: #fff;
            border-radius: 12px;
            box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
            display: inline-block;
            margin: 20px auto;
            max-width: 600px;
            /* 设置最大宽度 */
            width: 90%;
            /* 设置相对宽度 */
        }
        .button-container {
            margin: 20px auto;
            max-width: 600px;
        }
        .redirect-button {
            display: block;
            margin: 10px auto;
            padding: 15px;
            font-size: 18px;
            font-weight: bold;
            text-align: center;
            text-decoration: none;
            color: #fff;
            background-color: #333;
            border: 2px solid #333;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            width: 100%;
            box-sizing: border-box;
        }
        .redirect-button:hover {
            background-color: #222;
            border-color: #222;
        }
        #resultsContainer {
            background-color: #fff;
            border-radius: 12px;
            box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin: 20px auto;
            max-width: 600px;
            width: 90%;
        }
        .result-item {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid #ccc;
        }
        .result-item:last-child {
            border-bottom: none;
        }
        .result-name {
            font-weight: bold;
            color: #333;
        }
        .result-time {
            color: #666;
        }
        .fastest {
            color: #28a745;
            font-weight: bold;
        }
        #countdown {
            font-size: 18px;
            margin: 10px 0;
            color: #666;
        }

        /* 响应式设计 */
        @media only screen and (max-width: 600px) {
            h1 {
                font-size: 28px;
            }
            #loadingMessage {
                width: 90%;
            }
            .redirect-button {
                display: inline-block;
                margin: 10px;
                padding: 10px 20px;
                font-size: 16px;
                background-color: #333;
                color: #fff;
                text-decoration: none;
                border-radius: 8px;
                cursor: pointer;
                padding: 12px;
            }
            #loadingMessage, #resultsContainer {
                width: 95%;
                padding: 15px;
                max-width: 100%;
            }
        }
    </style>
</head>
<body>

<div id="menu"></div>
<script src="./assets/web/assets/jquery/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        $("#menu").load("./additions/menu/menu1.html", function() {
            adjustLinks();
            window.addEventListener('resize', adjustLinks);
        });
    });
</script>

<!--<section class="image3 cid-seogusrmXz" id="header1-f">-->
<section class="header1 cid-s48MCQYojq mbr-fullscreen" id="header1-f">
    <div class="align-center container-fluid">
        <div class="row justify-content-center">
            <div class="col-12 col-lg-8">
                <h1 class="mbr-section-title mbr-fonts-style mb-3 display-1">
                    <strong>Redirection</strong>
                </h1>

                <!-- 监控面板按钮 -->
                <a id="monitorButton" class="redirect-button" href="https://06my3sw3.status.cron-job.org/ " target="_blank"
                   style="width:240px; position: fixed; top: 120px; right: 80px; z-index: 1000;">
                    Backend Monitor Panel
                </a>

                <!-- 监控面板按钮 -->
                <a id="monitorButton2" class="redirect-button" href="https://ggpx90d7.status.cron-job.org/ " target="_blank"
                   style="width:240px; position: fixed; top: 180px; right: 80px; z-index: 1000;">
                    Frontend Monitor Panel
                </a>

                <p id="loadingMessage" class="mbr-text mbr-fonts-style display-7">
                    Detecting connection...
                </p>
                <div id="countdown" class="mbr-text mbr-fonts-style display-7"></div>

                <!-- 结果展示区域 -->
                <div id="resultsContainer" style="display: none;">
                    <h3>Connection Test Results</h3>
                    <div id="resultsList"></div>
                </div>

                <div class="button-container" id="buttonContainer" style="opacity: 1;">
                    <a id="redirectButton1" class="redirect-button" href="https://yukirinll.github.io/FFXIV_Phantoms_MainPage/#" target="_blank">
                        Route 1: GitHub [Fastly]
                    </a>
                    <a id="redirectButton2" class="redirect-button" href="https://yukirinll.gitee.io/ffxiv_phantoms_mainpage/#" target="_blank">
                        Route 2: Gitee [阿里云]
                    </a>
                    <a id="redirectButton3" class="redirect-button" href="https://ffxiv-phantoms-mainpage.pages.dev/#" target="_blank">
                        Route 3: Cloudflare [Anycast]
                    </a>
                    <a id="redirectButton4" class="redirect-button" href="https://ffxiv-phantoms-mainpage.onrender.com/#" target="_blank">
                        Route 4: Render [AWS CloudFront]
                    </a>
                    <a id="redirectButton5" class="redirect-button" href="https://ffxiv-phantoms-main-page.vercel.app/#" target="_blank">
                        Route 5: Vercel [AWS CloudFront]
                    </a>
                    <a id="redirectButton6" class="redirect-button" href="https://phantoms-t65xf0p6.maozi.io/" target="_blank">
                        Route 6: Maozi [Anycast]
                    </a>
                </div>
                <script>
                    document.addEventListener('DOMContentLoaded', function () {
                        // 发送HTTP请求
                        function measureResponseTime(url) {
                            return new Promise(function(resolve) {
                                var startTime = performance.now();
                                fetch(url, {
                                    mode: 'no-cors',
                                    cache: 'no-store',
                                    headers: {
                                        'Cache-Control': 'no-cache'
                                    }
                                })
                                    .then(function(response) {
                                        var endTime = performance.now();
                                        var responseTime = Math.round(endTime - startTime);
                                        resolve({
                                            url: url,
                                            time: responseTime,
                                            status: 'success'
                                        });
                                    })
                                    .catch(function() {
                                        resolve({
                                            url: url,
                                            time: Infinity,
                                            status: 'failed'
                                        });
                                    });
                            });
                        }

                        // 获取路由显示名称
                        function getRouteName(url) {
                            const routes = {
                                'github.io': 'GitHub [Fastly]',
                                'gitee.io': 'Gitee [阿里云]',
                                'pages.dev': 'Cloudflare [Anycast]',
                                'render.com': 'Render [AWS CloudFront]',
                                'vercel.app': 'Vercel [AWS CloudFront]',
                                'maozi.io': 'Maozi [Anycast]'
                            };
                            for (const [key, value] of Object.entries(routes)) {
                                if (url.includes(key)) return value;
                            }
                            return url;
                        }

                        // 检测所有页面的响应时间
                        Promise.all([
                            measureResponseTime('https://yukirinll.github.io/FFXIV_Phantoms_MainPage/'),
                            measureResponseTime('https://yukirinll.gitee.io/ffxiv_phantoms_mainpage/'),
                            measureResponseTime('https://ffxiv-phantoms-mainpage.pages.dev/'),
                            measureResponseTime('https://ffxiv-phantoms-mainpage.onrender.com/'),
                            measureResponseTime('https://ffxiv-phantoms-main-page.vercel.app/'),
                            measureResponseTime('https://phantoms-t65xf0p6.maozi.io/')
                        ]).then(function(results) {
                            var loadingMessage = document.getElementById('loadingMessage');
                            var resultsContainer = document.getElementById('resultsContainer');
                            var resultsList = document.getElementById('resultsList');

                            // 过滤出成功的请求
                            var successfulResults = results.filter(result => result.status === 'success');

                            if (successfulResults.length === 0) {
                                loadingMessage.textContent = 'Detection failed: All routes are unavailable';
                                document.getElementById('buttonContainer').style.opacity = '1';
                                return;
                            }

                            loadingMessage.textContent = 'Detection completed';
                            resultsContainer.style.display = 'block';

                            // 找出响应时间最短的成功请求
                            var fastestResult = successfulResults.reduce((prev, current) =>
                                (prev.time < current.time) ? prev : current
                            );

                            // 显示测试结果
                            results.forEach((result) => {
                                const resultItem = document.createElement('div');
                                resultItem.className = 'result-item';

                                const nameSpan = document.createElement('span');
                                nameSpan.className = 'result-name';
                                nameSpan.textContent = getRouteName(result.url);

                                const timeSpan = document.createElement('span');
                                timeSpan.className = 'result-time';

                                if (result.status === 'success') {
                                    timeSpan.textContent = `${result.time}ms`;
                                    if (result.url === fastestResult.url) {
                                        timeSpan.classList.add('fastest');
                                        timeSpan.textContent += ' (Fastest)';
                                    }
                                } else {
                                    timeSpan.textContent = 'Failed';
                                    timeSpan.style.color = '#dc3545';
                                }

                                resultItem.appendChild(nameSpan);
                                resultItem.appendChild(timeSpan);
                                resultsList.appendChild(resultItem);
                            });

                            // 启用所有按钮
                            document.getElementById('buttonContainer').style.opacity = '1';

                            // 倒计时自动跳转
                            var countdownElement = document.getElementById('countdown');
                            var seconds = 45;

                            function updateCountdown() {
                                countdownElement.textContent = `Auto redirecting to fastest route in ${seconds} seconds...`;
                                if (seconds === 0) {
                                    clearInterval(countdownInterval);
                                    window.location.href = fastestResult.url;
                                }
                                seconds--;
                            }

                            // 如果想开始倒计时，可以将下面2行取消注释
                            var countdownInterval = setInterval(updateCountdown, 1000);
                             updateCountdown();

                        }).catch(function(error) {
                            document.getElementById('loadingMessage').textContent = 'Detection error: ' + error;
                            document.getElementById('buttonContainer').style.opacity = '1';
                        });
                    });
                </script>
            </div>
        </div>
    </div>
</section>

<!-- 引入访客统计模块 -->
<script src="visitor-tracker.js"></script>
<!-- Cloudflare Web Analytics -->
<script defer src='./lib/cloudflare/beacon.min.js' data-cf-beacon='{"token": "0e55e488041949479a3dace73ef940cd"}'>
</script>
<!-- End Cloudflare Web Analytics -->

<section class="footer7 cid-seeJHoNSny" once="footers" id="footer7-p">
    <div class="container">
        <div class="media-container-row align-center mbr-white">
            <div class="col-12">
                <p class="mbr-text mb-0 mbr-fonts-style display-7">
                    Copyright (C) SQUARE ENIX CO., LTD. All Rights Reserved.
                    <br>
                    Copyright&nbsp;(C) Crystal Alliance cir. All Rights Reserved.
                </p>
            </div>
        </div>
    </div>
</section>
<section style="background-color: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif; color:#aaa; font-size:12px; padding: 0; align-items: center; display: flex;">
    <a href="https://mobirise.site/n" style="flex: 1 1; height: 3rem; padding-left: 1rem;">
    </a>
    <p style="flex: 0 0 auto; margin:0; padding-right:1rem;">
        Page was
        <a href="https://mobirise.site/g" style="color:#aaa;">
            designed
        </a>
        with Mobirise
    </p>
</section>
<script src="assets/web/assets/jquery/jquery.min.js">
</script>
<script src="assets/popper/popper.min.js">
</script>
<script src="assets/tether/tether.min.js">
</script>
<script src="assets/bootstrap/js/bootstrap.min.js">
</script>
<script src="assets/smoothscroll/smooth-scroll.js">
</script>
<script src="assets/ytplayer/jquery.mb.ytplayer.min.js">
</script>
<script src="assets/vimeoplayer/jquery.mb.vimeo_player.js">
</script>
<script src="assets/dropdown/js/nav-dropdown.js">
</script>
<script src="assets/dropdown/js/navbar-dropdown.js">
</script>
<script src="assets/touchswipe/jquery.touch-swipe.min.js">
</script>
<script src="assets/theme/js/script.js">
</script>

<!-- 页脚部分保持不变 -->
</body>

<div id="foot"></div>
<script src="./assets/web/assets/jquery/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        $("#foot").load("./additions/foot/profile-round.html");
    });
</script>

</html>
